local key = KEYS[1]
local arg1 = ARGV[1]

local value = redis.call("get", key)
if value ~= nil and value == arg1 then
    return redis.call("del", key)
else
    return 0
end